<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib" 
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	xmlns:c="http://java.sun.com/jstl/core"
	template="/layout/contentLayout.xhtml">
	
	<ui:param name="param_pageTitle" value="#{messages.luyuan_crm_menu_order}" />
	<ui:param name="param_navigationUrl" value="/luyuan/product/navigationProduct.jsf" />
	
	<ui:define name="road">
		<span><h:outputLink value="">产品类型</h:outputLink></span>
	</ui:define>
	
	<!-- content -->	
	<ui:define name="content">
		<h:form id="productForm">
			<rg:areaPanel>
				<rg:areaPanel type="searchPanel" style="margin-top: 10px;">
					<rg:fieldSet column="auto" labelWidth="80px" >
						<rg:inputText id="typeName" label="产品类别名称" value="#{productTypeAction.criteria.typeName}" />
					    <rg:field>
							<h:commandButton styleClass="button" value="搜索" />
						</rg:field>
					</rg:fieldSet>
				</rg:areaPanel>
				<rg:titlePanel headerTitle="产品类别列表" style="margin-top: 10px;" needButton="true" readonly="false">
					<ui:define name="headerActions">
						<h:commandLink onclick="UI.instance.showDialog({id:'addProduct', src:'/luyuan/product/addProductType.jsf'});" value="增加"/>
						<h:commandLink value="批量删除"  onclick="if(!EccnUtil.isAnyRowChecked('productTable', null , 'id')){return false;};">
							<rg:confirm event="onclick" action="#{productTypeAction.batchDelete()}" message="是否确定删除这些产品" disableDefault="true" reRender="productTable,globalMessage"/>
						</h:commandLink>
					</ui:define>
					<rg:table tableId="productTable" value="#{productTypeAction.tableModel}" var="item">
						<rg:column property="id"  cellType="checkbox" headerType="checkbox" headerStyle="width:4%;" />
						<rg:column property="typeName" title="产品类别"  />
						<rg:column property="question.questionName" title="健康申请表" sortable="false"/>
						<rg:column property="description" title="类型描述" sortable="false"/>
						<rg:column title="#{messages.luyuan_crm_operator}">
							<ul class="links">
								<li>
									<h:outputLink value="#" onclick="UI.instance.showDialog({id:'updateProduct', src:'/luyuan/product/updateProductType.jsf?productTypeId=#{item.id}'});">修改</h:outputLink>
								</li>
								<li>
									<h:commandLink value="#{messages.luyuan_crm_delete}" action="#{productTypeAction.deleteByProductId(item.id)}"/>
								</li>
							</ul>
						</rg:column>
					</rg:table>
				</rg:titlePanel>
			</rg:areaPanel>
		</h:form>
		<a:form>
			<a:jsFunction name="reRenderProductTable" reRender="productTable"/>
		</a:form>
	</ui:define>
</ui:composition>